﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NodeBasedSkillEditor.Model.CommandHistory
{
    public class Record_SubPort
    {
        public string DataJson;
        public uint PortId;
        public uint GroupLocalId;
        public int IndexInParentGroup;

        public Record_SubPort(ViewModel.VM_Port portVM)
        {
            if (portVM.ParentGroup != null && !portVM.IsExpandPort)
            {
                DataJson = SwifterJson.XFormatter.ToJson(portVM.BindPortData);
                PortId = portVM.Id;
                GroupLocalId = portVM.ParentGroup.LocalId;
                IndexInParentGroup = portVM.IndexInParentGroup;
            }
        }
    }
}
